<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="UTF-8" />
	<title>千郡医疗</title>
	<meta name="keywords" content="" />
	<meta name="description" content="" />
	<meta name="format-detection" content="telephone=no" />
	<link rel="stylesheet" th:href="@{/weixin/css/style.css}" />
	<link rel="stylesheet" th:href="@{/weixin/css/dropload.css}" />
	<link rel="stylesheet" th:href="@{/weixin/css/weui.min.css}" />
	<script type="text/javascript"  th:src="@{/weixin/js/adaptive.js}"></script>
	<script type="text/javascript"  th:src="@{/weixin/js/fastclick.min.js}"></script>
	<script type="text/javascript"  th:src="@{/weixin/js/zepto.min.js}"></script>
	<script type="text/javascript"  th:src="@{/weixin/js/dropload.min.js}"></script>
	<script type="text/javascript" th:src="@{/weixin/js/weui.min.js}"></script>
	<script type="text/javascript" th:src="@{/assets/js/plugins/moment/moment.js}"></script>
	<style>
	.noneBorder{
		border: none;
	}
	body{font-size: initial !important;}
	</style>
</head>
<body>
		<div class="customerPage">
			<section class="wrapper">
			<div class="top tc">
				<p>我的客户</p>
				<p class="num" th:text="${customerCount }">300</p>
				<div class="box-h t-b">
					<a class="flex">顾客列表</a>
				</div>
			</div>
			
				<div class="contain">
					<div class="ktab customerList">
					<table>
					<thead>
						<tr>
							<td>姓名</td>
							<td>累计消费总额</td>
						</tr>
					</thead>
					<tbody id="content">
						
					</tbody>
				</table>
				</div>
				</div>
			</section>
		</div>
	
	<script  th:inline="JavaScript">
    var query = {'distributorId':[[${distributorId}]]};
	</script>
	
	<script type="text/javascript">
	/*<![CDATA[*/
	 page = 0;
	 $('.wrapper').dropload({
		    //scrollArea : window,
		    autoLoad : true,//自动加载
		    loadDownFn : function(me){
		      window.history.pushState(null, document.title, window.location.href); 
		      var queryUrl = '';
		      
		        $.ajax({
		            type: 'GET',
		            url: "/qianjun/weixin/customer/findMyCustomer?page=" + page,
		            dataType: 'json',
		            data: query,
		            success: function(data){
		                if(data.content.length == 0){
		                    me.lock();
		                    me.noData();
		                    me.resetload();
		                    return;
		                }

				        var result = '';
		                for(var i=0; i< data.content.length; i++){
		                  result+=content(data.content[i]);
		                }
		                $('#content').append(result);
		                page++;
		                me.resetload();
		            },
		            error: function(xhr, type){
		                me.resetload();
		            }
		        });
		    }
		});
	 
	 function content(data){
			var html = '<tr><td>' + data.name + '</td><td>' + data.amount + '</td></tr>';
			return html;
		}
	 
	 function toPayment(orderId){
		 window.location.href = "/qianjun/weixin/order/paymentList?orderId=" + orderId;
	 }
	 /*]]>*/
	</script>
</body>
</html>